package Data::Conveyor::Ticket::Payload::Instruction;
# ptags: DCTPI

use warnings;
use strict;
use Class::Value;


our $VERSION = '0.02';


use base 'Class::Scaffold::Storable';


use overload
    'eq' => 'eq',
    '""' => 'stringify';


__PACKAGE__
    ->mk_framework_object_accessors(
        value_payload_instruction_command => 'command',
    )
    ->mk_object_accessors('Class::Value' => 'value');


# Override type() in subclasses. Override value() as well; should be a value
# object corresponding to the type of instruction.

use constant type  => '';

sub eq {
    my ($lhs, $rhs) = @_;
    (sprintf "%s", $lhs) eq (sprintf "%s", $rhs);
}


sub stringify {
    my $self = shift;
    sprintf 'command [%s], type [%s], value [%s]',
        $self->command, $self->type, $self->value;
}


sub check {
    my ($self, $exception_container, $ticket) = @_;
    $self->value->run_checks_with_exception_container($exception_container);

}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - stage-based conveyor-belt-like ticket handling system

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

None yet. This is an early release; fully functional, but undocumented. The
next release will have more documentation.

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

